libostree: Allow OstreeAsyncProgress:status to be set atomically
authorPhilip Withnall <withnall@endlessm.com>
Fri, 28 Apr 2017 18:04:29 +0000 (19:04 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Sat, 29 Apr 2017 11:50:15 +0000 (11:50 +0000)
commitce83abb868a6ecff5e8563532e76e742579e5064
treeb37087d6268cd487059ca81f944d3bce236ea0a0
parentcdf876101be1b61202489c40c8f5b2749a02577d
libostree: Allow OstreeAsyncProgress:status to be set atomically

Rework how the status is handled in OstreeAsyncProgress so that it’s now
a well-known key in the hash table. This means that it can be retrieved
and set atomically with other keys using
ostree_async_progress_[get|set]().

The behaviour of ostree_async_progress_[get|set]_status() is preserved,
with the caveat that `status` can now also be accessed using the other
API on OstreeAsyncProgress, and has to be accessed with the right
GVariant type.

Internally, a NULL status is represented by an empty status string
(since ostree_async_progress_[get|set]_variant() deliberately don’t
allow NULL variants to be set against keys, since that would break the
ostree_async_progress_get() API).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #819
Approved by: cgwalters
src/libostree/ostree-async-progress.c